"""
针对登录接口进行测试
接口请求地址：http://129.211.129.101:9006/user/login.do
接口请求参数：username，password
预期结果：登录成功、用户名不存在、密码错误
"""
import csv

import requests

url = "http://129.211.129.101:9006/user/login.do"
file = open("../data/logintest.csv", "r", encoding='utf-8')
table = csv.reader(file)
userinfo = {}
i = 0
for row in table:
    if i == 0:
        pass
    else:
        userinfo['username'] = row[0]
        userinfo['password'] = row[1]
        userinfo['res'] = row[2]
        r = requests.post(url, data=userinfo).json()
        print(r)
    i = i + 1


